WPF和Silverlight版Chart2D帮助文档
添加标签到饼图

要将多个值添加到饼图标签中,可以创建如下标签模板:

XAML
拷贝代码
<c1chart:C1Chart Name="c1Chart1" ChartType="Pie">
      <c1chart:C1Chart.Resources>
        <DataTemplate x:Key="lbl">
          <StackPanel>
            <StackPanel Orientation="Horizontal">
              <TextBlock Text="{Binding Path=Name}" />
              <TextBlock Text="=" />
              <TextBlock Text="{Binding Path=Value}" />
            </StackPanel>
            <TextBlock Text="{Binding Path=PercentageSeries,Converter={x:Static c1chart:Converters.Format}, ConverterParameter=#.#%}"/>
          </StackPanel>
        </DataTemplate>
      </c1chart:C1Chart.Resources>
      <c1chart:C1Chart.Data>
        <c1chart:ChartData>
          <c1chart:ChartData.ItemNames>P1 P2 P3 P4 P5</c1chart:ChartData.ItemNames>
          <c1chart:DataSeries Values="20 22 19 24 25" PointLabelTemplate="{StaticResource lbl}" />
        </c1chart:ChartData>
      </c1chart:C1Chart.Data>
      <c1chart:C1ChartLegend DockPanel.Dock="Right" />
    </c1chart:C1Chart>
查看其它

 

 


产品网站:http://www.gcpowertools.com.cn  |  咨询热线:4006576008   |   ©2015 西安葡萄城